package JAVA300.第九章容器;

import java.util.*;

/**
 * 使用容器存储表格数据
 * ORM思想的简单实验： map表示一行数据，整张表存在list
 */
public class TestStoreTableData {
    public static void main(String[] args) {

        Map<String,Object> row1 = new HashMap<>();
        row1.put("id",01);
        row1.put("name","hqq");
        row1.put("salary",30000);

        Map<String,Object> row2 = new HashMap<>();
        row2.put("id",02);
        row2.put("name","qyh");
        row2.put("salary",30001);


        List<Map<String,Object>> table = new ArrayList<>();
        table.add(row1);
        table.add(row2);


        for (Map<String,Object> row:table){

            Set<String> keySet = row.keySet();
            for (String key:keySet){
                System.out.print(key+"："+row.get(key)+"\t");
            }
            System.out.println();
        }
    }
}
